import { nFormatter } from '@/utils/nFormatter'

export default {
  backgroundColor: '#1c213e',
  tooltip: {
    appendToBody: true,
    formatter: function(val = {}) {
      const {
        data: { value, endTime, startTime },
        marker
      } = val
      return `${marker}开始日期:${startTime}<br />
              ${marker}结束日期:${endTime}<br/>
              ${marker}零用气个数: ${value}`
    }
  },
  xAxis: {
    name: '',
    type: 'category',
    nameTextStyle: {
      color: '#fff'
    },
    nameGap: 25,
    nameLocation: 'center',
    splitLine: {
      lineStyle: {
        type: 'dashed'
      }
    }
  },
  yAxis: {
    name: '个数',
    type: 'value',
    scale: true,
    nameTextStyle: {
      color: '#fff',
      align: 'right'
    },
    splitLine: {
      lineStyle: {
        type: 'dashed'
      }
    },
    axisLabel: {
      formatter: function(val) {
        return nFormatter(val)
      }
    }
  },
  series: [
    {
      type: 'line',
      symbolSize: 4
    }
  ],
  grid: {
    top: 25,
    left: '5%',
    right: '5%',
    bottom: '45'
  }
}
